/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wwcontrolserver.sensor;

//import wwcontrolserver.SensorComputationsServer;
import wwcontrolserver.sensor.AbstractSensor.*;

/**
 *
 * @author Michael Ferry
 */
public class SensorPHORP_1130 extends AbstractSensor {
    public static int PHMODE_1130 = 0;
    public static int ORPMODE_1130 = 1;
    private final int sensor_mode;
    private static final boolean ratiometric = false;
    private final SensorRKey SRKey;

    //ifk_P3_serial, P3_pH_SNUM,CALGROUP_P3, "P3 pH"
    public SensorPHORP_1130(int ifkSerial,int SNUM, int CALGROUP, String SNAME,int sensor_mode){
        super(ifkSerial,SNUM,CALGROUP,SNAME);
        this.sensor_mode = sensor_mode;
        SRKey = new SensorRKey(ifkSerial,ratiometric);
    }   
    @Override
    public double ComputedSensorValue(int SensorRawValue, double DYNR){
        if(sensor_mode == PHMODE_1130) {
            return SensorComputationsServer.ComputePHmV(SensorRawValue, DYNR);
        }
        //If sensor is not in pH mode it must be in ORP mode so return that
        else {
            return SensorComputationsServer.ComputeORPmV(SensorRawValue, DYNR);
        }
        
    }
    @Override
    public boolean GetRatiometric(){
        return ratiometric;
    }
    @Override
    public SensorRKey GetSensorRKey(){
        return SRKey;
    }
}
